<?php
/* @var $this MembroController */
/* @var $model Membro */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'membro-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'nome'); ?>
		<?php echo $form->textField($model,'nome',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'nome'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sobrenome'); ?>
		<?php echo $form->textField($model,'sobrenome',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'sobrenome'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'data_nascimento'); ?>
		<?php
		$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    'model' => $model,
		    'attribute' => 'data_nascimento',
			//'language' => 'pt',	// TODO NÃO ESTÁ FUNCIONANDO
			//'i18nScriptFile' => 'jquery.ui.datepicker-pt.js',
/* 			'themeUrl' => Yii::app()->baseUrl . '/css/jui',
			'theme' => 'softark',
			'cssFile' => 'jquery-ui-1.9.2.custom.css',
 */			'options' => array(
					'showOn' => 'both',             // also opens with a button
					'dateFormat' => 'yy-mm-dd',     // format of "2012-12-25"
					'showOtherMonths' => true,      // show dates in other months
					'selectOtherMonths' => true,    // can seelect dates in other months
					'changeYear' => true,           // can change year
					'changeMonth' => true,          // can change month
					'yearRange' => '1900:'. date('Y'),     // range of year
					'minDate' => '1900-01-01',      // minimum date
					'maxDate' => date('Y'). '12-31',      // maximum date
					'showButtonPanel' => true,      // show button panel
			),
			'htmlOptions' => array(
					'size' => '10',
					'maxlength' => '10',
			),
		));
		?>
		<?php echo $form->error($model,'data_nascimento'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'data_conversao'); ?>
		<?php
		$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    'model' => $model,
		    'attribute' => 'data_conversao',
			//'language' => 'pt',	// TODO NÃO ESTÁ FUNCIONANDO
			//'i18nScriptFile' => 'jquery.ui.datepicker-pt.js',
/* 			'themeUrl' => Yii::app()->baseUrl . '/css/jui',
			'theme' => 'softark',
			'cssFile' => 'jquery-ui-1.9.2.custom.css',
 */			'options' => array(
					'showOn' => 'both',             // also opens with a button
					'dateFormat' => 'yy-mm-dd',     // format of "2012-12-25"
					'showOtherMonths' => true,      // show dates in other months
					'selectOtherMonths' => true,    // can seelect dates in other months
					'changeYear' => true,           // can change year
					'changeMonth' => true,          // can change month
					'yearRange' => '1900:'. date('Y'),     // range of year
					'minDate' => '1900-01-01',      // minimum date
					'maxDate' => date('Y'). '12-31',      // maximum date
					'showButtonPanel' => true,      // show button panel
			),
			'htmlOptions' => array(
					'size' => '10',
					'maxlength' => '10',
			),
		));
		?>
		<?php echo $form->error($model,'data_conversao'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'data_batismo'); ?>
		<?php
		$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    'model' => $model,
		    'attribute' => 'data_batismo',
			//'language' => 'pt',	// TODO NÃO ESTÁ FUNCIONANDO
			//'i18nScriptFile' => 'jquery.ui.datepicker-pt.js',
/* 			'themeUrl' => Yii::app()->baseUrl . '/css/jui',
			'theme' => 'softark',
			'cssFile' => 'jquery-ui-1.9.2.custom.css',
 */			'options' => array(
					'showOn' => 'both',             // also opens with a button
					'dateFormat' => 'yy-mm-dd',     // format of "2012-12-25"
					'showOtherMonths' => true,      // show dates in other months
					'selectOtherMonths' => true,    // can seelect dates in other months
					'changeYear' => true,           // can change year
					'changeMonth' => true,          // can change month
					'yearRange' => '1900:'. date('Y'),     // range of year
					'minDate' => '1900-01-01',      // minimum date
					'maxDate' => date('Y'). '12-31',      // maximum date
					'showButtonPanel' => true,      // show button panel
			),
			'htmlOptions' => array(
					'size' => '10',
					'maxlength' => '10',
			),
		));
		?>
		<?php echo $form->error($model,'data_batismo'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'rg'); ?>
		<?php echo $form->textField($model,'rg',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'rg'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'rg_orgao'); ?>
		<?php echo $form->textField($model,'rg_orgao',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'rg_orgao'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'cpf'); ?>
		<?php echo $form->textField($model,'cpf',array('size'=>11,'maxlength'=>11)); ?>
		<?php echo $form->error($model,'cpf'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sexo'); ?>
		<?php echo $form->dropDownList($model, 'sexo', Membro::getOpcoesSexo()); ?>
		<?php echo $form->error($model,'sexo'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'grau_instrucao'); ?>
		<?php echo $form->dropDownList($model, 'grau_instrucao', Membro::getOpcoesGrauInstrucao()); ?>
		<?php echo $form->error($model,'grau_instrucao'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'curso'); ?>
		<?php echo $form->textField($model,'curso',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'curso'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'nacionalidade'); ?>
		<?php echo $form->textField($model,'nacionalidade',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'nacionalidade'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'estado_civil'); ?>
		<?php echo $form->dropDownList($model, 'estado_civil', Membro::getOpcoesEstadoCivil()); ?>
		<?php echo $form->error($model,'estado_civil'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'profissao_id'); ?>
		<?php echo $form->dropDownList($model, 'profissao_id', 
				CHtml::listData(Profissao::model()->findAll(), 'profissao_id', 'descricao') ); ?>
		<?php echo $form->error($model,'profissao_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'logradouro'); ?>
		<?php echo $form->textField($model,'logradouro',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'logradouro'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'numero'); ?>
		<?php echo $form->textField($model,'numero',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'numero'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'complemento'); ?>
		<?php echo $form->textField($model,'complemento',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'complemento'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'bairro'); ?>
		<?php echo $form->textField($model,'bairro',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'bairro'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'cidade_id'); ?>
		<?php echo $form->dropDownList($model, 'cidade_id', 
				CHtml::listData(Cidade::model()->findAll(), 'cidade_id', 'descricao') ); ?>
		<?php echo $form->error($model,'cidade_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'estado_id'); ?>
		<?php echo $form->dropDownList($model, 'estado_id', 
				CHtml::listData(Estado::model()->findAll(), 'estado_id', 'sigla') ); ?>
		<?php echo $form->error($model,'estado_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'cep'); ?>
		<?php echo $form->textField($model,'cep',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'cep'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'pais_id'); ?>
		<?php echo $form->dropDownList($model, 'pais_id', 
				CHtml::listData(Pais::model()->findAll(), 'pais_id', 'descricao') ); ?>
		<?php echo $form->error($model,'pais_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'telefone_residencial'); ?>
		<?php echo $form->textField($model,'telefone_residencial',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'telefone_residencial'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'telefone_trabalho'); ?>
		<?php echo $form->textField($model,'telefone_trabalho',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'telefone_trabalho'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'telefone_celular'); ?>
		<?php echo $form->textField($model,'telefone_celular',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'telefone_celular'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ativo'); ?>
		<div class="compactRadioGroup">
		<?php echo $form->radioButtonList($model, 'ativo', Membro::getOpcoesAtivo(), array('separator' => "&nbsp;&nbsp; | &nbsp;&nbsp;")); ?>
		</div>
		<?php echo $form->error($model,'ativo'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'motivo_inatividade_id'); ?>
		<?php echo $form->dropDownList($model, 'motivo_inatividade_id', Membro::getOpcoesMotivoInatividade()); ?>
		<?php echo $form->error($model,'motivo_inatividade_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->